-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Implement constant folding during the mem2reg pass #2464
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Maxim Vezenov <[email protected]>
jfecher
changed the title
Jf/mem2reg constant folding
fix: Implement constant folding during the mem2reg pass
Aug 28, 2023
jfecher
commented
Aug 28, 2023
jfecher
commented
Aug 28, 2023
Also fixes #2221 |
vezenovm
reviewed
Aug 29, 2023
vezenovm
reviewed
Aug 29, 2023
vezenovm
reviewed
Aug 29, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM just a couple small comments
vezenovm
approved these changes
Aug 29, 2023
TomAFrench
added a commit
that referenced
this pull request
Aug 30, 2023
TomAFrench
added a commit
that referenced
this pull request
Aug 31, 2023
* master: chore: update ACIR artifacts (#2503) chore!: Update to `acvm-backend-barretenberg` v0.12.0 (#2377) fix: Bring back accidentally deleted double_verify_proof test. (#2501) chore(aztec_noir): import aztec library if not found yet (#2492) chore(abi)!: Replace struct name with fully qualified struct path (#2374) chore!: Remove keys from preprocessed artifacts (#2283) chore(noir): Release 0.10.5 (#2482) feat: Basic implementation of traits (#2368) fix: Implement constant folding during the mem2reg pass (#2464)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Problem*
Resolves #2445
Summary*
This is the second PR of mem2reg updates and requires the array aliasing PR to work.
This PR changes mem2reg to also perform constant folding while doing the pass instead of calling
set_value_from_id
. The reasoning for this is given in #2445 but in short, you could run into situations before where after mem2reg, constant folding would find and stop at another reference, necessitating another mem2reg and constant folding pass, and so in. So if you had N mem2reg + constant folding passes you could always construct a program that required N + 1. Performing constant folding during mem2reg breaks this dependency as now anarray_get
instruction that can be simplified is simplified out immediately instead of remaining as an opaque alias to some unknown reference.Documentation
This PR requires documentation updates when merged.
Additional Context
PR Checklist*
cargo fmt
on default settings.